﻿#singleinstance force

;this script will repeatedly send 2 keypresses to a WoW client that was last active when this script was first run
;you can change the 2 keys here, default is Left (left arrowkey) and Right (right arrowkey)
;other logical options are ie: 
;left_key  =a
;right_key =d
;      or
;left_key  =q
;right_key =e
left_key  =Left
right_key =Right

repeat_in := 1000*5*60 ;delay between repeats in miliseconds

ControlGet, WoW_HWND, Hwnd,,, World of Warcraft
loop, 5{ ;repeat a few times so you can make sure it got the correct WoW client
	ControlSend, , {%left_key% DOWN},  ahk_id %WoW_HWND%
	sleep, 100
	ControlSend, , {%left_key% UP},  ahk_id %WoW_HWND%
	sleep, 50
	ControlSend, , {%right_key% DOWN},  ahk_id %WoW_HWND%
	sleep, 100
	ControlSend, , {%right_key% UP},  ahk_id %WoW_HWND%
	sleep, 500
}
loop{
	ControlSend, , {%left_key% DOWN},  ahk_id %WoW_HWND%
	sleep, 100
	ControlSend, , {%left_key% UP},  ahk_id %WoW_HWND%
	sleep, 50
	ControlSend, , {%right_key% DOWN},  ahk_id %WoW_HWND%
	sleep, 100
	ControlSend, , {%right_key% UP},  ahk_id %WoW_HWND%
	sleep, %repeat_in%
}